Method for encoding signal, and method for decoding signal

ABSTRACT

The present disclosure relates to a method, apparatus, and system for encoding and decoding signals. The encoding method includes: converting a first-domain signal into a second-domain signal; performing Linear Prediction (LP) processing and Long-Term Prediction (LTP) processing for the second-domain signal; obtaining a long-term flag value according to a decision criterion; obtaining a second-domain predictive signal according to the LP processing result and the LTP processing result when the long-term flag value is a first value; obtaining a second-domain predictive signal according to the LP processing result when the long-term flag value is a second value; converting the second-domain predictive signal into a first-domain predictive signal, and calculating a first-domain predictive residual signal; and outputting a bit stream that includes the first-domain predictive residual signal.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.13/172,575, filed on Jun. 29, 2011, which is a continuation ofInternational Application No PCT/CN2009/076306, filed on Dec. 30, 2009.The International Application PCT/CN2009/076306 claims priority toChinese Patent Application No. 200810247427.6, filed on Dec. 31, 2008,and Chinese Patent Application No. 200910151835.6, filed on Jun. 25,2009. All of the aforementioned patent applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to speech encoding and decoding, and inparticular, to methods, apparatuses, and system for encoding anddecoding signals.

BACKGROUND

One of the coding models widely applied in the speech coding field isCode Excited Linear Prediction (CELP) model. The CELP model uses analmost white excitation signal to excite two time-varying linearrecursive filters. The excitation signal is generally selected out of acodebook composed of Gaussian white noise sequences. The feedback loopof each filter includes a predictor. One of the predictors is along-term predictor (or a pitch predictor), which is represented byP(z). P(z) is used to generate the tone structure of a voiced speech(for example, the fine structure of a spectrum). Another commonpredictor is a short-term predictor, represented by F(z). F(z) is usedto recover the short-term spectrum envelope of a speech. This modelderives from its reverse process. That is, F(z) is used to remove theredundancy of a near sample point of the speech signal, and P(z) is usedto remove the redundancy of a far sample point of the speech signal. Anormalized residual signal is obtained through two levels of prediction.The residual signals take on standard normal distribution approximately.

When the CELP model is applied to the lossy compression field, a speechsignal x(i) undergoes a Linear Predictive Coding (LPC) analysis first toobtain a LPC residual signal res(i). After the LPC residual signalres(i) is framed, each subframe signal undergoes a Long-Term Prediction(LTP) analysis to obtain a corresponding adaptive codebook and anadaptive codebook gain. The adaptive codebook may be searched out inmany methods such as autocorrelation. After the long-term dependence ofthe LPC residual signal res(i) is removed, a LTP residual signal x2(i)is obtained. After an algebraic codebook is used to characterize or fitthe LTP residual signal x2(i), the whole coding process is completed.Finally, the adaptive codebook and the fixed codebook are coded andwritten into the bit stream, and a joint vector quantization or a scalarquantization is performed for the adaptive codebook gain and the fixedcodebook gain. In the codebook, either the adaptive codebook gain or thefixed codebook gain is selected as the best gain. The indexcorresponding to the best gain is transmitted to the decoder. The wholecoding process takes place in a Pulse Code Modulation (PCM) domain.

In the lossless compression field, a Moving Pictures Experts Group AudioLossless Coding (MPEG ALC) apparatus also uses the short-term andlong-term dependence of speech signals for prediction. Its predictionprocess is: first, a LPC analysis is performed for a speech signal, anda LPC coefficient undergoes entropy coding and is written into a bitstream; second, LTP is performed for the LPC residual signal to obtainthe pitch and the pitch gain of the LTP, and the LPC residual signal iswritten into the bit stream; after the LTP, the LTP residual signal isobtained; and then, finally, the LTP residual signal undergoes entropycoding and is written into the bit stream, and the whole coding processis ended.

In the prior art described above, when the speech signal is lessperiodic, the LTP processing almost makes no contribution. In this case,the LTP residual signal is still written into the bit stream.Consequently, the pitch gain quantization consumes too many bits, andthe compression performance of the coder is reduced.

SUMMARY

Embodiments of the present disclosure provide method, apparatus, andsystem for encoding and decoding signals to improve the compressionperformance of the codec.

In a first aspect, a signal encoding method is provided. The methodincludes:

-   -   converting a first-domain signal into a second-domain signal;    -   performing a Linear Predictive (LP) processing and a Long-Term        Prediction (LTP) processing for the second-domain signal;    -   obtaining a long-term flag value according to a decision        criterion;    -   obtaining a second-domain predictive signal according to the LP        processing result and the LTP processing result when the        long-term flag value is a first value, or obtaining a        second-domain predictive signal according to the LP processing        result when the long-term flag value is a second value;    -   converting the second-domain predictive signal into a        first-domain predictive signal, and calculating a first-domain        predictive residual signal; and    -   outputting a bit stream that comprises the first-domain        predictive residual signal.

In a second aspect, a signal decoding method is provided. The methodincludes:

-   -   decoding a received bit stream to obtain a first-domain        predictive residual signal;    -   decoding the first sample point of a current frame of the bit        stream;    -   performing the following decoding steps consecutively for every        sample point starting from the second sample point of the        current frame:    -   calculating an Linear Predictive (LP) signal of the sample point        according to a second-domain signal of the decoded sample point;    -   obtaining a second-domain predictive signal according to the LP        signal and an LTP contribution signal if an obtained long-term        flag value is a first value, wherein the LTP contribution signal        is obtained according to the LP residual signal of the decoded        sample point;    -   obtaining a second-domain predictive signal according to the LP        signal if they obtained long-term flag value is not a first        value;    -   converting the second-domain predictive signal into a        first-domain predictive signal, and decoding a first-domain        signal of the current sample point according to the first-domain        predictive residual signal and the first-domain predictive        signal; and    -   converting the first-domain signal of the current sample point        into a second-domain signal, and obtaining an LP residual signal        according to the second-domain signal and the LP signal.

In a third aspect, a signal encoding apparatus is provided. The signalencoding apparatus includes:

-   -   a converting module, configured to convert a first-domain signal        into a second-domain signal, and convert a second-domain        predictive signal into a first-domain predictive signal;    -   an Linear Predictive (LP) module, configured to perform a LP        processing for the second-domain signal;    -   an Long-Term Prediction (LTP) module, configured to perform a        LTP processing for the second-domain signal;    -   a deciding module, configured to obtain a long-term flag value        according to a decision criterion;    -   a second-domain prediction module, configured to obtain the        second-domain predictive signal according to the LP processing        result and the LTP processing result of the second-domain signal        when the long-term flag value is a first value; and obtain the        second-domain predictive signal according to the LP processing        result of the second-domain signal when the long-term flag value        is a second value;    -   a first-domain predictive residual module, configured to        calculate a first-domain predictive residual signal according to        the first-domain predictive signal;    -   an outputting module, configured to output a bit stream that        includes the first-domain predictive residual signal.

In a fourth aspect, a signal decoding apparatus is provided. The signaldecoding apparatus includes:

-   -   a bit stream decoding module, configured to decode a received        bit stream to obtain a first-domain predictive residual signal;    -   a first sample point decoding module, configured to decode a        first sample point of the signals of a current frame;    -   an LP module, configured to calculate an LP signal of a current        sample point according to a second-domain signal of the decoded        sample point;    -   a second-domain prediction module, configured to obtain a        second-domain predictive signal according to the LP signal and        an LTP contribution signal if an obtained long-term flag value        is a first value, or obtain a second-domain predictive signal        according to the LP signal if the obtained long-term flag value        is not a first value, where the LTP contribution signal is        obtained according to the LP residual signal of the decoded        sample point;    -   a converting module, configured to: convert the second-domain        predictive signal into a first-domain predictive signal, and        convert the first-domain signal of the current sample point into        the second-domain signal;    -   a current sample point decoding module, configured to decode the        first-domain signal of the current sample point according to the        first-domain predictive residual signal and the first-domain        predictive signal; and    -   an LP residual module, configured to obtain an LP residual        signal according to the second-domain signal and the LP signal.

In a fifth aspect, a signal encoding/decoding (codec) system isprovided. The signal codec system includes:

-   -   a signal encoding apparatus, configured to: convert a        first-domain signal into a second-domain signal; perform a        Linear Predictive (LP) processing and a Long-Term Prediction        (LTP) processing for the second-domain signal; obtain a        long-term flag value according to a decision criterion; obtain a        second-domain predictive signal according to the LP processing        result and the LTP processing result of the second-domain signal        when the long-term flag value is a first value; or obtain a        second-domain predictive signal according to the LP processing        result of the second domain signal when the long-term flag value        is a second value; convert the second-domain predictive signal        into a first-domain predictive signal, and calculate a        first-domain predictive residual signal; and output a bit stream        that includes the first-domain predictive residual signal; and    -   a signal decoding apparatus, configured to: decode the received        bit stream to obtain the first-domain predictive residual signal        and the long-term flag value; decode a first sample point of the        signals of a current frame; perform the following decoding steps        consecutively for every current sample point from a second        sample point of the signals of the current frame: calculate an        LP signal of a current sample point according to the        second-domain signal of the decoded sample point; obtain the        second-domain predictive signal according to the LP signal and        an LTP contribution signal if the obtained long-term flag value        is the first value, or obtain the second-domain predictive        signal according to the LP signal if the obtained long-term flag        value is not the first value, where the LTP contribution signal        is obtained according to the LP residual signal of the decoded        sample point; convert the second-domain predictive signal into        the first-domain predictive signal, and decode the first-domain        signal of the current sample point according to the first-domain        predictive residual signal and the first-domain predictive        signal; and convert the first-domain signal of the current        sample point into the second-domain signal, and obtain the LP        residual signal according to the second-domain signal and the LP        signal.

According to the embodiments of the present disclosure, a subsequentencoding or decoding process is performed adaptively according to along-term flag value; when the long-term flag value is a second value,it is not necessary to consider the LTP processing result, thusimproving the compression performance of the codec.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flowchart of a signal encoding method according to the firstembodiment of the present disclosure;

FIG. 2 is a flowchart of a signal encoding method according to thesecond embodiment of the present disclosure;

FIG. 3 shows signals of a frame after framing in the signal encodingmethod according to the second embodiment of the present disclosure;

FIG. 4 is a flowchart of a signal decoding method according to the thirdembodiment of the present disclosure;

FIG. 5 is a flowchart of a signal decoding method according to thefourth embodiment of the present disclosure;

FIG. 6 is a flowchart of step 404 in the signal decoding methodaccording to the fourth embodiment of the present disclosure;

FIG. 7 is a flowchart of step 405 in the signal decoding methodaccording to the fourth embodiment of the present disclosure;

FIG. 8 is a simplified block diagram of a signal encoding apparatusaccording to a fifth embodiment of the present disclosure;

FIG. 9 is a simplified block diagram of a signal decoding apparatusaccording to a sixth embodiment of the present disclosure; and

FIG. 10 is a simplified block diagram of a signal codec system accordingto a seventh embodiment of the present disclosure.

DETAILED DESCRIPTION

The present disclosure is hereinafter described in more detail withreference to accompanying drawings and exemplary embodiments.

First Embodiment

FIG. 1 is a flowchart of a signal encoding method according to the firstembodiment of the present disclosure. The method includes the followingsteps:

Step 101: Convert a first-domain signal into a second-domain signal.

Step 102: Perform a Linear Predictive (LP) processing and a Long-TermPredication (LTP) processing for the second-domain signal.

Step 103: Obtain a long-term flag value according to a decisioncriterion.

Step 104: Obtain a second-domain predictive signal according to the LPprocessing result and the LTP processing result of the second-domainsignal when the long-term flag value is a first value; or obtain asecond-domain predictive signal according to the LP processing result ofthe second-domain signal when the long-term flag value is a secondvalue.

Step 105: Convert the second-domain predictive signal into thefirst-domain predictive signal, and calculate a first-domain predictiveresidual signal.

Step 106: Output a bit stream that includes the first-domain predictiveresidual signal.

In this embodiment, the long-term flag value is obtained according tothe decision criterion; the second-domain predictive signal is obtainedaccording to the LP processing result and the LTP processing result whenthe long-term flag value is the first value, or the second-domainpredictive signal is obtained according to the LP processing result whenthe long-term flag value is the second value, and the bit stream isobtained according to the second-domain predictive signal. In thisembodiment, the subsequent encoding process is performed adaptivelyaccording to the long-term flag value. When the long-term flag value isthe second value, it is not necessary to consider the LTP processingresult, thus improving the compression performance of the codec.

Second Embodiment

FIG. 2 is a flowchart of a signal encoding method according to thesecond embodiment of the present disclosure. In this embodiment, thefirst domain is a nonlinear domain, and further, the first domain may bean A-law or Mu-law domain; the second domain is a PCM domain; the LPprocessing is a Linear Predictive Coding (LPC) processing, and the LTPprocessing is a Long Term Prediction processing.

The method according to this embodiment includes the following steps:

Step 201: Convert a nonlinear-domain signal into a PCM-domain signal.

Input signals may be formatted in frames. A frame length L isrepresented by the number of samples in a frame. Supposing that x(i)represents the nonlinear-domain signal, and y(i) represents thePCM-domain signal, where i is the i^(th) sample in the frame. Alsosupposing that the conversion process involves precision loss, and thecorresponding back-conversion process involves no precision loss.

Step 202: Perform the LPC processing for the entire-frame signal y(i) ofthe PCM domain to obtain an LP processing result. The LP processingresult includes a LPC predictive signal y′(i) which serves as an LPsignal, and an LP coefficient, as expressed in the following equation:

$\begin{matrix}{{{y^{\prime}(i)} = {\sum\limits_{j = 1}^{{lpc}\;\_\;{order}}{a_{j} \cdot {y\left( {i - j} \right)}}}}{{i = 1},2,\ldots\mspace{14mu},{L - 1}}} & (1)\end{matrix}$

-   -   where a_(j) is an LP coefficient; L is the frame length; and        lpc_order is an LP order. Supposing y′(0)=0, when i<0, y(i)=0.

Step 203: Calculate a LPC residual signal res(i) that serves as an LPresidual signal according to the PCM-domain signal y(i) and the LPCpredictive signal y′(i), where the LPC residual signal may also beregarded as the LP processing result.res(i)=y(i)−y′(i) i=0, 1, . . . , L−1  (2)

Step 204: Perform framing for the LPC residual signal res(i), and thenperform an LTP processing to obtain an LTP processing result. Theframing operation is optional, and it may be an adaptive framingoperation. The LTP processing result includes a pitch and a pitch gain.

Specifically, the LTP processing in this step may include: performing apitch search for the LPC residual signal, obtaining the best pitch ofthe LPC residual signal, or obtaining both the best pitch and the pitchgain of the LPC residual signal.

Specifically, this step may include:

if no framing is performed, performing the pitch search for thePCM-domain signal of the current frame to obtain the best pitch of thePCM-domain signal, and then performing a fine search for the LPCresidual signal according to the best pitch of the PCM-domain signal toobtain the best pitch of the LPC residual signal or obtain both the bestpitch and the pitch gain of the LPC residual signal; if framing isperformed, before the framing operation, performing pitch search for thePCM-domain signal of the current frame to obtain the best pitch of thePCM-domain signal, using the best pitch of the PCM-domain signal of thecurrent frame as the best pitch of the first subframe, and performingframing for the LPC residual signal according to the best pitch;performing a fine search for the pitch of each subframe in the residualdomain, namely, searching for the pitch of each subframe around thepitch of the previous subframe, thus facilitating differential codingfor the subframe pitch, and obtaining the best pitch of each subframe,or obtaining both the best pitch and the pitch gain.

In the foregoing process of searching for a pitch, if no pitch gain isobtained, the pitch gain may be selected adaptively according to theobtained best pitch.

In the LPC processing, the prediction result of the first few samples isgenerally inaccurate. To avoid impacting the LTP performance, thisembodiment specifies that the first M samples do not participate in theLTP processing, where M is a specified number. The pitch search isperformed for the LPC residual signals res(i) of the samples other thanthe first M samples to obtain the pitch, pitch gain, and LTP residualsignal z(i) of each subframe.

FIG. 3 shows signals of a frame after framing in the signal encodingmethod according to the second embodiment of the present disclosure. Thefirst M samples do not participate in the framing or LTP processing, andthe relation between M and lpc_order is: 0≦M≦lpc_order. T₁ representsthe pitch of the first subframe, and the samples from M to T₁+M−1 arethe samples in the buffer. Supposing n₀=T₁+M, then the samples from n₀to n₁−1 are the samples in the first subframe, and the length of thefirst subframe is N₁=n₁−n₀. By analogy, the samples from n_(j−1) ton_(j)−1 are the samples in subframe j, and the length of subframe j isN_(j)=n_(j)−n_(j−1). The total quantity of samples of the signals in aframe is L.

For the samples from 0 to T₁+M−1, the following equation applies:z(i)=res(i) i=0,1, . . . , T ₁ +M−1  (3)

where z(i) are LTP residual signals.

For the samples of the first subframe, the following equation applies:z(i)=res(i)−g ₁ ·res(i−T ₁) i=n ₀ , . . . , n ₁−1  (4)

where g₁ represents the pitch gain of the first subframe.

For the samples of subframe j, the following equation applies:z _(j)(i)=res _(j)(i)−g _(j) ·res _(j)(i−T _(j)) i=n _(j−1) , . . . , n_(j)−1  (5)

where T_(j) represents the pitch of subframe j, and g_(j) represents thepitch gain of subframe j.

Step 205: Judge whether a product of an empirical factor and the energyof the LPC residual signals res(i) (which have undergone no LTPprocessing) is greater than the energy of the LTP residual signals z(i)(which have undergone LTP processing); if so, proceed to step 206;otherwise, go to step 207.

$\begin{matrix}{{E\; 1} = {\sum\limits_{i = k}^{L - 1}{{z(i)} \cdot {z(i)}}}} & (6) \\{E = {\sum\limits_{i = k}^{L - 1}{{{res}(i)} \cdot {{res}(i)}}}} & (7)\end{matrix}$

E1 represents the energy of the LTP residual signal z(i); E representsthe energy of the LPC residual signal res(i); and k may be 0 or M. Thisstep judges whether E*fac is greater than E1, where fac is the empiricalfactor. Generally, fac=0.94.

As an another embodiment, an alternative of this step is: Judge whetherthe product of the empirical factor and the sum of absolute values ofthe LPC residual signals res(i) (which have undergone no LTP processing)is greater than the sum of absolute values of the LTP residual signalsz(i) (which have undergone LTP processing); if so, proceed to step 206;otherwise, go to step 207.

Step 206: Assign a first value to the long-term flag Tflag.Specifically, let Tflag be 1. Go to step 208.

The long-term flag may be a trigger signal for the LTP processing. IfTflag is equal to 1, the LTP processing is performed.

Step 207: Assign a second value to the long-term flag Tflag.Specifically, let Tflag be 0. Go to step 210. If Tflag is equal to 0,the LTP processing is not performed.

Step 208: Obtain an LTP contribution signal res′(i) according to thepitch, pitch gain and the LPC residual signal res(i). This step may alsobe included in step 204. That is, this step may be included in the LTPprocessing, and the LTP processing result further includes the LTPcontribution signal res′(i), as expressed in equation (8):res′(i)=g·res(i−T)  (8)

Step 209: Use the sum of the LPC predictive signal y′(i) and the LTPcontribution signal res′(i) as the PCM predictive signal y″(i), and goto step 211, as expressed in equation (9):y″(i)=y′(i)+res′(i)   (9)

Step 210: Use the LPC predictive signal y′(i) as the PCM predictivesignal y″(i), and proceed to step 211, as expressed in equation (10):y″(i)=y′(i)  (10)

Step 211: Convert the PCM predictive signal y″(i) into thenonlinear-domain predictive signal x′(i), as expressed in equation (11):x′(i)=PCM 2A[y″(i)]  (11)

The function PCM 2A[ ] refers to converting the PCM-domain signal intothe A-law domain signal.

Step 212: Calculate the difference between x(i) and x′(i) to obtain thenonlinear-domain predictive residual signal, and perform entropy codingfor the nonlinear-domain predictive residual signal.

Step 213: Output the bit stream that includes the entropy code of thenonlinear-domain predictive residual signal and the long-term flagvalue. Specifically, when Tflag is equal to 0, the bit stream furtherincludes an LPC coefficient a_(j); when Tflag is equal to 1, the bitstream further includes an LPC coefficient a_(j), a pitch, and a pitchgain.

In some instances, in the length-varying coding field, when Tflag isequal to 0, the LTP processing is not performed, and there is no need toinclude the long term flag value in the bit stream; when Tflag is equalto 1, the LTP processing is performed, and the long term flag value isincluded in the bit stream, and this bit stream further includes an LPCcoefficient a_(j), a pitch, and a pitch gain.

In this embodiment, by judging whether the product of the empiricalfactor and the energy of the LPC residual signals (which have undergoneno LTP processing) is greater than the energy of the LTP residualsignals (which have undergone LTP processing), the system knows whetherthe LTP processing is performed or not. When the speech signals are lessperiodic, the LTP processing almost makes no contribution, and the LTPprocessing is not performed. Therefore, it is not necessary to considerthe LTP contribution signals; fewer bits are consumed; and thecompression performance of the encoder is improved.

Third Embodiment

FIG. 4 is a flowchart of a signal decoding method according to the thirdembodiment of the present disclosure. The method in this embodiment maycorrespond to the signal encoding method in the first embodiment, andthe definitions of the terms and parameter expressions in thisembodiment are the same as those in the first embodiment. The methodincludes the following steps:

Step 301: Decode a received bit stream to obtain the first-domainpredictive residual signal.

Step 302: Decode the first sample point of the signals of the currentframe.

Perform the decoding steps 303-306 consecutively for every currentsample point from the second sample point of the signals of the currentframe:

Step 303: Calculate the LP signal and the LP residual signal of thecurrent sample point according to the second-domain signal of thedecoded sample point.

Step 304: Obtain the second-domain predictive signal according to the LPsignal and the LTP contribution signal if the obtained long-term flagvalue is the first value, or obtain the second-domain predictive signalaccording to the LP signal if the obtained long-term flag value is notthe first value, where the LTP contribution signal is obtained accordingto the LP residual signal of the decoded sample point.

Step 305: Convert the second-domain predictive signal into thefirst-domain predictive signal, and decode the first-domain signal ofthe current sample point according to the first-domain predictiveresidual signal and the first-domain predictive signal.

Step 306: Convert the first-domain signal of the current sample pointinto the second-domain signal.

In this embodiment, the subsequent decoding process is performedadaptively according to the long-term flag value; when the long-termflag value is the second value, it is not necessary to consider the LTPcontribution signals, thus simplifying the decoding process.

Fourth Embodiment

FIG. 5 is a flowchart of a signal decoding method according to thefourth embodiment of the present disclosure. The method in thisembodiment may correspond to the signal encoding method in the secondembodiment, and the definitions of the terms and parameter expressionsin this embodiment are the same as those in the second embodiment. Themethod in this embodiment includes the following steps:

Step 401: Decode a received bit stream to obtain the nonlinear-domainpredictive residual signal and the long-term flag value.

In some instances, if the bit stream is a bit stream encoded with thelong-term flag value, the bit stream may be decoded to obtain thelong-term flag value. Specifically, when the long-term flag value Tflagis equal to 0, the bit stream further includes an LPC coefficient a_(j);when Tflag is equal to 1, the bit stream further includes an LPCcoefficient a_(j), a best pitch, and may further include a pitch gain.If the bit stream includes no pitch gain, the method in this embodimentfurther includes: selecting the pitch gain adaptively according to thebest pitch.

Supposing d(i) represents the nonlinear-domain predictive residualsignal, the following equation applies:d(i)=x(i)−x′(i) i=0, 1, . . . , L−1  (12)

Therefore, the nonlinear-domain signal x(i) may be obtained throughequation (13) after decoding:x(i)=d(i)+x′(i) i=0, 1, . . . , L−1  (13)

Step 402: Decode the first sample point of the signals of the currentframe.

The first sample point has undergone no LPC processing. Therefore, thenonlinear-domain predictive signal of the first sample point is x′(0)=0.Equation (13) reveals that the first sample point of the nonlineardomain may be decoded without loss, namely, x(0)=d(0).

For the subsequent decoding process, this embodiment needs to retain thePCM-domain signal y(0) of the first sample point and the LPC residualsignal res(0) (namely, the LP residual signal), where:y(0)=A2PCM[x(0)], res(0)=y(0)  (14)

The function A2PCM[ ] refers to converting the A-law domain signal intothe PCM-domain signal.

In some instances, in the length-varying coding field, the received bitstream is decoded to obtain the first-domain predictive residual signal,without obtaining the long-term flag value which is the second value.When the decoding result includes the long-term flag value which is thefirst value, it indicates that the LTP module is enabled; otherwise, theLTP module is disabled. The system obtains the second-domain predictivesignal according to the LP signal and the LTP contribution signal if theobtained long-term flag value is the first value, or obtains thesecond-domain predictive signal according to the LP signal if theobtained long-term flag value is not the first value, where the LTPcontribution signal is obtained according to the LP residual signal ofthe decoded sample point.

Step 403: Judge whether the value of the long-term flag value is thefirst value; if it is the first value, proceed to steps 404-405;otherwise, skip to steps 406-408.

The LTP processing comes in two options: performed (Tflag=1), and notperformed (Tflag=0). In this step, the system judges whether Tflag isequal to 1; alternatively, the system may judge whether Tflag is equalto 0 to know whether the LTP processing is performed. Different optionsof the LTP processing correspond to different subsequent decodingprocesses.

After completion of step 403 in this embodiment, the following decodingprocess is a cyclic recursive process. The following decoding steps areperformed consecutively for every current sample point from the secondsample point of the signals of the current frame:

In some instances, if the encoder side does not output the codes of thelong-term flag value which is the second value, the system judgeswhether the first value is obtained as the long-term flag value; if itis the first value, steps 404-405 are performed; otherwise, steps406-408 are performed.

Step 404: Decode the first T₁+M−1 samples except the first sample point.

The method in this embodiment corresponds to the signal encoding methodin the second embodiment. That is, in the encoding process, the first Msamples the current frame do not participate in the LTP processing.Therefore, in this embodiment, the first M samples and the samples inthe buffer are decoded first.

FIG. 6 is a flowchart of step 404 in the signal decoding method in thefourth embodiment of the present disclosure. Further, step 404 mayinclude the following steps:

Step 4041: Calculate the LPC predictive signal y′(i) of the currentsample point according to the PCM-domain signal y(i) of the decodedsample point through equation (15):

$\begin{matrix}{{{y^{\prime}(i)} = {\sum\limits_{j = 1}^{{lpc}\;\_\;{order}}{a_{j} \cdot {y\left( {i - j} \right)}}}}{{i = 1},2,\ldots\mspace{14mu},{T_{1} + M - 1}}} & (15)\end{matrix}$

When i≦0, y(i)=0.

For example, if the current sample point is the second sample point ofthe signals of the current frame, the decoded sample point is the firstsample point of the signals of the current frame. In this case, thedecoding result in step 402 serves as a reference.

Step 4042: Obtain the PCM-domain predictive signal y″(i) according tothe LPC predictive signal y′(i) of the current sample. Because the firstT₁+M samples are not involved in the LTP processing, y″(i)=y′(i). Thatis, the value of the LPC predictive signal of the current sample pointis assigned to the PCM-domain predictive signal y″(i).

Step 4043: Convert the PCM-domain predictive signal y″(i) into thenonlinear-domain predictive signal x′(i):x′(i)=PCM 2A[y″(i)]  (16)

Step 4044: Obtain the nonlinear-domain signal x(i) through equation (13)according to the nonlinear-domain predictive signal x′(i) and thenonlinear-domain predictive residual signal d(i).

Step 4045: For the purpose of decoding subsequent samples, convert thenonlinear-domain signal x(i) into the PCM-domain signal y(i), and obtainthe LPC residual signal res(i) according to the PCM-domain signal y(i)and the LPC predictive signal y′(i).res(i)=y(i)−y′(i) i=0, 1, . . . , T ₁ +M−1  (17)

Step 405: Decode all the subframe signals except the first T₁+M samples.

FIG. 7 is a flowchart of step 405 in the signal decoding methodaccording to the fourth embodiment of the present disclosure. Step 405may include the following steps:

Step 4051: Calculate the LPC predictive signal y′(i) of the currentsample point according to the PCM-domain signal y(i) of the decodedsample point through equation (18):

$\begin{matrix}{{{y^{\prime}(i)} = {\sum\limits_{j = 1}^{{lpc}\;\_\;{order}}{a_{j} \cdot {y\left( {i - j} \right)}}}}{{i = n_{0}},\ldots\mspace{14mu},{L - 1}}} & (18)\end{matrix}$

When i≦0, y(i)=0.

For example, if the current sample point is the first sample point ofthe first subframe, the decoded samples are the first T₁+M samples. Inthis case, the decoding result in step 404 serves as a reference.

Step 4052: Calculate the PCM-domain predictive signal y″(i) according tothe LPC predictive signal y′(i) of the current sample point throughequation (19):y″(i)=y′(i)+res′(i)=y′(i)+g·res(i−T)  (19)

Step 4053: Convert the PCM-domain predictive signal y″(i) into thenonlinear-domain predictive signal x′(i):x′(i)=PCM 2A[y″(i)]  (20)

Step 4054: Obtain the nonlinear-domain signal x(i) through equation (13)according to the nonlinear-domain predictive signal x′(i) and thenonlinear-domain predictive residual signal d(i).

Step 4055: For the purpose of decoding subsequent samples, convert thenonlinear-domain signal x(i) into the PCM-domain signal y(i), and obtainthe LPC residual signal res(i) according to the PCM-domain signal y(i)and the LPC predictive signal y′(i).res(i)=y(i)−y′(i) i=n ₀ , . . . , L−1  (21)

After completion of decoding the current sample point, in the process ofdecoding subsequent samples, the LPC residual signal obtained in step4055 is used to calculate the PCM-domain predictive signals ofsubsequent samples.

Step 406: Calculate the LPC predictive signal y′(i) of the currentsample point according to the PCM-domain signal y(i) of the decodedsample point through equation (22):

$\begin{matrix}{{{y^{\prime}(i)} = {\sum\limits_{j = 1}^{{lpc}\;\_\;{order}}{a_{j} \cdot {y\left( {i - j} \right)}}}}{{i = 1},2,\ldots\mspace{14mu},{L - 1}}} & (22)\end{matrix}$

When i≦0, y(i)=0.

Step 407: Use the LPC predictive signal y′(i) as the PCM-domainpredictive signal, and convert the PCM-domain predictive signal into thenonlinear-domain predictive signal x′(i).

Because the LTP module is disabled and no sample point of the currentframe signals is involved in the LTP processing, y″(i)=y′(i), and y′(i)may be converted into x′(i) directly.

Step 408: Obtain the nonlinear-domain signal x(i) through equation (13)according to the nonlinear-domain predictive signal x′(i) and thenonlinear-domain predictive residual signal d(i).

In this embodiment, the subsequent decoding process is performedadaptively according to the long-term flag value; when the long-termflag value is the second value, it is not necessary to consider the LTPcontribution signals, thus simplifying the decoding process.

Fifth Embodiment

FIG. 8 shows a simplified structure of a signal encoding apparatusaccording to the fifth embodiment of the present disclosure. Theapparatus includes: a converting module 11, an LP module 12, an LTPmodule 13, a deciding module 14, a second-domain prediction module 15, afirst-domain predictive residual module 16, and an outputting module 17.The converting module 11 is configured to: convert a first-domain signalinto a second-domain signal, and convert a second-domain predictivesignal into a first-domain predictive signal. The LP module 12 isconfigured to perform LP processing for the second-domain signal. TheLTP module 13 is configured to perform LTP processing for thesecond-domain signal. The deciding module 14 is configured to obtain along-term flag value according to a decision criterion. Thesecond-domain prediction module 15 is configured to: obtain thesecond-domain predictive signal according to the LP processing resultand the LTP processing result when the long-term flag value is the firstvalue, and obtain the second-domain predictive signal according to theLP processing result when the long-term flag value is the second value.The first-domain predictive residual module 16 is configured tocalculate the first-domain predictive residual signal according to thefirst-domain predictive signal. The outputting module 17 is configuredto output a bit stream that includes the first-domain predictiveresidual signal.

The foregoing LP processing result may include an LP coefficient, LPsignals, and LP residual signals. The foregoing bit stream may furtherinclude an LP coefficient.

Further, the LTP module 13 may perform pitch search for the LP residualsignals to obtain the best pitch or both the best pitch and the pitchgain of the LP residual signals, and obtain the LTP contributionsignals. The LTP processing result may include the best pitch or boththe best pitch and the pitch gain, LTP contribution signals, and LTPresidual signals.

The second-domain prediction module 15 is configured to use the sum ofthe LP residual signal and the LTP contribution signal as thesecond-domain predictive signal when the long-term flag value is thefirst value, or use the LP signal as the second-domain predictive signalwhen the long-term flag value is the second value.

The deciding module 14 may make a decision according to one of the twodecision criteria, namely, (a) judge whether the product of theempirical factor and the energy of the LP residual signal is greaterthan the energy of the LTP residual signal, or (b) judge whether theproduct of the empirical factor and the sum of the absolute values ofthe LP residual signals is greater than the sum of the absolute valuesof the LTP residual signals. If the product of the empirical factor andthe energy of the LP residual signal is greater than the energy of theLTP residual signal, or the product of the empirical factor and the sumof the absolute values of the LP residual signals is greater than thesum of the absolute values of the LTP residual signals, the decidingmodule 14 assigns the value of the first flag to the long-term flag(i.e. the long-term flag value is the first value); otherwise, thedeciding module 14 assigns the value of the second flag to the long-termflag (i.e. the long-term flag value is the second value).

The apparatus in this embodiment may further include a pitch gain modulewhich selects the pitch gain adaptively according to the obtained bestpitch, and may further include a framing module which performs framingfor the LP residual signals.

In this embodiment, the subsequent encoding process is performedadaptively according to the long-term flag value; when the long-termflag value is the second value, it is not necessary to consider the LTPprocessing result, thus improving the compression performance of thecodec.

Sixth Embodiment

FIG. 9 shows a simplified structure of a signal decoding apparatusaccording to a sixth embodiment of the present disclosure. The apparatusincludes: a bit stream decoding module 21, a first sample point decodingmodule 22, an LP module 23, a second-domain prediction module 24, aconverting module 25, a current sample point decoding module 26, and anLP residual module 27. The bit stream decoding module 21 is configuredto decode a received bit stream to obtain the first-domain predictiveresidual signal. The first sample point decoding module 22 is configuredto decode the first sample point of the signals of the current frame.The LP module 23 is configured to calculate the LP signal of the currentsample point according to the second-domain signal of the decoded samplepoint. The second-domain prediction module 24 is configured to: obtainthe second-domain predictive signal according to the LP signal and theLTP contribution signal if the obtained long-term flag value is thefirst value, or obtain the second-domain predictive signal according tothe LP signal if the obtained long-term flag value is not the firstvalue, where the LTP contribution signal is obtained according to the LPresidual signal of the decoded sample point. The converting module 25 isconfigured to convert the second-domain predictive signal into thefirst-domain predictive signal, and convert the first-domain signal ofthe current sample point into the second-domain signal. The currentsample point decoding module 26 is configured to decode the first-domainsignal of the current sample point according to the first-domainpredictive residual signal and the first-domain predictive signal. TheLP residual module 27 is configured to obtain the LP residual signalaccording to the second-domain signal and the LP signal.

Further, when the long-term flag value is the first value and thecurrent sample point is involved in the LTP processing at the encoder,the second-domain prediction module 24 uses the sum of the LP signal andthe LTP contribution signal as the second-domain predictive signal; whenthe long-term flag value is the first value and the current sample pointis not involved in the LTP processing at the encoder, the second-domainprediction module 24 uses the LP signal as the second-domain predictivesignal.

The apparatus in this embodiment may further include a pitch gain modulewhich selects the pitch gain adaptively according to the obtained bestpitch.

In this embodiment, the subsequent decoding process is performedadaptively according to the long-term flag value; when the long-termflag value is the second value, it is not necessary to consider the LTPcontribution signals, thus simplifying the decoding process.

Seventh Embodiment

FIG. 10 shows a simplified structure of a signal codec system accordingto a seventh embodiment of the present disclosure. The system includes asignal encoding apparatus 31 and a signal decoding apparatus 32.

The signal encoding apparatus 31 is configured to convert a first-domainsignal into a second-domain signal; perform LP processing and LTPprocessing for the second-domain signal; obtain a long-term flag valueaccording to a decision criterion; obtain the second-domain predictivesignal according to the LP processing result and the LTP processingresult when the long-term flag value is the first value; obtain thesecond-domain predictive signal according to the LP processing resultwhen the long-term flag value is the second value; convert thesecond-domain predictive signal into the first-domain predictive signal,and calculate the first-domain predictive residual signal; and output abit stream that includes the first-domain predictive residual signal.

The signal decoding apparatus 32 is configured to decode the receivedbit stream to obtain the first-domain predictive residual signal; decodethe first sample point of the signals of the current frame; perform thefollowing decoding steps consecutively for every current sample pointfrom the second sample point of the signals of the current frame:calculate the LP signal of the current sample point according to thesecond-domain signal of the decoded sample point; obtain thesecond-domain predictive signal according to the LP signal and the LTPcontribution signal if the obtained long-term flag value is the firstvalue, where the LTP contribution signal is obtained according to the LPresidual signal of the decoded sample point; or obtain the second-domainpredictive signal according to the LP signal if the obtained long-termflag value is not the first value; convert the second-domain predictivesignal into the first-domain predictive signal, and decode thefirst-domain signal of the current sample point according to thefirst-domain predictive residual signal and the first-domain predictivesignal; and convert the first-domain signal of the current sample pointinto the second-domain signal, and obtain the LP residual signalaccording to the second-domain signal and the LP signal.

Further, the signal encoding apparatus 31 in this embodiment may be anysignal coding apparatus described in the foregoing embodiments; and thesignal decoding apparatus 32 may be any signal decoding apparatusdescribed in the foregoing embodiments.

It is understandable to those skilled in the art that all or part of thesteps of the foregoing method embodiments may be implemented by hardwareinstructed by a program. The program may be stored in acomputer-readable storage medium. When being executed, the programperforms steps of the foregoing method embodiments. The storage mediummay be any medium suitable for storing program codes, for example, aRead Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk,or a compact disk.

What is claimed is:
 1. A signal encoding method, comprising: convertinga first-domain signal into a second-domain signal; performing a LinearPrediction (LP) processing and a Long-Term Prediction (LTP) processingfor the second-domain signal to obtain a LP processing result and a LTPprocessing result, wherein the LP processing result comprises a LPsignal and a LP residual signal, and the LTP processing result comprisesa LTP residual signal, a best pitch of the LP residual signal or boththe best pitch of the LP residual signal and a pitch gain of the LPresidual signal; obtaining a long-term flag value based on a comparisonbetween the LP residual signal and the LTP residual signal; if thelong-term flag value is a first value, obtaining a second-domainpredictive signal based on the LP processing result and the LTPprocessing result, or, if the long-term flag value is a second value,obtaining the second-domain predictive signal based on the LP processingresult; converting the second-domain predictive signal into afirst-domain predictive signal, and calculating a first-domainpredictive residual signal; and outputting a bit stream that comprisesthe first-domain predictive residual signal.
 2. The method of claim 1,wherein the second-domain signal is formatted into frames, each framecomprises one or more sample points, wherein the LP processing resultcomprises the LP residual signal at the one or more sample points andfurther comprises one or more LP coefficients corresponding to the oneor more sample points, and wherein the bit stream further comprises theLP coefficients.
 3. The method of claim 2, wherein the LTP residualsignal at the one or more sample points is calculated based on the LPresidual signal at the one or more sample points, and obtaining thelong-term flag value based on a comparison between the LP residualsignal and the LTP residual signal comprises: calculating an energy ofthe LP residual signal by taking a sum of the energy of the LP residualsignal at some or all of the one or more sample points; calculating anenergy of the LTP residual signal by taking a sum of the energy of theLTP residual signal at some or all of the one or more sample points;assigning the first value to the long-term flag if the product of theenergy of the LP residual signals and empirical factor is greater thanthe energy of the LTP residual signals; or assigning the second value tothe long-term flag if the product of the energy of the LP residualsignals and the empirical factor is not greater than the energy of theLTP residual signals.
 4. The method of claim 1, wherein the LTPprocessing result further comprises a LTP contribution signal.
 5. Themethod of claim 4, wherein obtaining the second-domain predictive signalbased on the LP processing result and the LTP processing resultcomprises: using the sum of the LP signal and the LTP contributionsignal as the second-domain predictive signal.
 6. The method of claim 1,wherein before performing the LP processing, the method furthercomprises: performing a pitch search for the second-domain signal; andobtaining a best pitch of the second-domain signal.
 7. The method ofclaim 6, wherein performing the LTP processing comprises: performing afine search for the LP residual signal according to the best pitch ofthe second-domain signal; obtaining the best pitch of the LP residualsignal or both the best pitch of the LP residual signal and the pitchgain of the LP residual signal; and obtaining an LTP contribution signalaccording to the LP residual signal and one of the best pitch of the LPresidual signal and the pitch gain of the LP residual signal.
 8. Themethod of claim 6, wherein after performing the pitch search for thesecond-domain signal and obtaining the best pitch of the second domainsignal, the method further comprises: selecting a pitch gain of thesecond-domain signal adaptively according to the obtained best pitch ofthe second-domain signal.
 9. The method of claim 1, wherein obtainingthe second-domain predictive signal based on the LP processing resultcomprises: using the LP signal as the second-domain predictive signal.10. The method of claim 1, wherein obtaining the long-term flag valuebased on a comparison between the LP residual signal and the LTPresidual signal comprises: assigning the first value to the long-termflag if the product of the energy of the LP residual signal and anempirical factor is greater than the energy of the LTP residual signal;or assigning the second value to the long-term flag if the product ofthe energy of the LP residual signal and the empirical factor is notgreater than the energy of the LTP residual signal.
 11. A signaldecoding method, comprising: decoding a received bit stream to obtain afirst-domain predictive residual signal and a long-term flag value,wherein the first-domain predictive residual signal is formatted intoframes, each frame comprises one or more sample points; decoding thefirst sample point of a current frame of the first-domain predictiveresidual signal; performing the following decoding steps consecutivelyfor every current sample point of the current frame of the first-domainpredictive residual from the second sample point of the current frame ofthe first-domain predictive residual signal: calculating a LinearPrediction (LP) signal of a current sample point according to asecond-domain signal of the decoded sample point, wherein the bit streamcomprises both a best pitch and a pitch gain, or both the bit streamcomprises the best pitch and a pitch gain; if the long-term flag valueis a first value, obtaining a second-domain predictive signal accordingto the LP signal and a Long-Term Prediction (LTP) contribution signal,wherein the LTP contribution signal is obtained based on the LP residualsignal of the decoded sample point; or if the long-term flag value isnot the first value, obtaining the second-domain predictive signal basedon the LP signal; converting the second-domain predictive signal into afirst-domain predictive signal, and decoding a first-domain signal ofthe current sample point according to the first-domain predictiveresidual signal and the first-domain predictive signal; and convertingthe first-domain signal of the current sample point into a second-domainsignal, and obtaining an LP residual signal according to thesecond-domain signal and the LP signal.
 12. The method of claim 11,wherein obtaining a second-domain predictive signal according to the LPsignal and an LTP contribution signal comprises: if the current samplepoint in encoder side participates in the LTP processing, using the sumof the LP residual signal and the LTP contribution signal as thesecond-domain predictive signal; if the current sample point in encoderside does not participate in the LTP processing, using the LPCpredictive signal as the second-domain predictive signal.
 13. A signalencoding apparatus, comprising a signal converter, a signal processorand a signal output, wherein the signal converter is configured toconvert a first-domain signal into a second-domain signal; the signalprocessor is configured to: perform a Linear Prediction (LP) processingand a Long-Term Prediction (LTP) processing for the second-domain signalto obtain a LP processing result and a LTP processing result, whereinthe LP processing result comprises a LP signal and a LP residual signal,the LTP processing result comprises a LTP residual signal, a best pitchof the LP residual signal or both the best pitch of the LP residualsignal and a pitch gain of the LP residual signal; obtain a long-termflag value based on a comparison between the LP residual signal and theLTP residual signal; and obtain a second-domain predictive signal basedon the LP processing result and the LTP processing result if thelong-term flag value is a first value, or obtain the second-domainpredictive signal based on the LP processing result if the long-termflag value is a second value; the signal converter is further configuredto convert the second-domain predictive signal into a first-domainpredictive signal; the signal processor is further configured tocalculate a first-domain predictive residual signal according to thefirst-domain predictive signal; and the signal output is configured tooutput a bit stream that comprises the first-domain predictive residualsignal.
 14. The apparatus of claim 13, wherein the second-domain signalis formatted into frames, each frame comprises one or more samplepoints, wherein the LP processing result comprises the LP residualsignal at the one or more sample points and further comprises one ormore LP coefficients corresponding to the one or more sample points, andwherein the bit stream further comprises the LP coefficients.
 15. Theapparatus of claim 14, wherein the LTP residual signal at the one ormore sample points is calculated based on the LP residual signal at theone or more sample points; and in obtaining the long-term flag valuebased on a comparison between the LP residual signal and the LTPresidual signal, the signal processor is configured to: calculate anenergy of the LP residual signal by taking a sum of the energy of the LPresidual signal at some or all of the one or more sample points;calculate an energy of the LTP residual signal by taking a sum of theenergy of the LTP residual signal at some or all of the one or moresample points; assign the first value to the long-term flag if a productof the energy of the LP residual signal and an empirical factor isgreater than the energy of the LTP residual signal; or assign the secondvalue to the long-term flag if the product of the energy of the LPresidual signal and the empirical factor is not greater than the energyof the LTP residual signal.
 16. The apparatus of claim 13, whereinbefore performing the LP processing, the signal processor is furtherconfigured to: perform a pitch search for the second-domain signal andobtain a best pitch of the second-domain signal; and select a pitch gainof the second-domain signal adaptively according to the obtained bestpitch of the second-domain signal.
 17. The apparatus of claim 13,wherein the LTP processing result further comprises a LTP contributionsignal, and wherein in obtaining the second-domain predictive signal,the signal processor is configured to: use the sum of the LP residualsignal and the LTP contribution signal as the second-domain predictivesignal if the long-term flag value is the first value; or use the LPCpredictive signal as the second-domain predictive signal if thelong-term flag value is the second value.
 18. A signal decodingapparatus, comprising: a bit stream decoding module, configured todecode a received bit stream to obtain a first-domain predictiveresidual signal and a long-term flag value, wherein the first-domainpredictive residual signal is formatted into frames, each framecomprises one or more sample points; a first sample point decodingmodule, configured to decode a first sample point of a current framesignal; a sample point decoding module, configured to perform thefollowing decoding steps consecutively for every current sample point ofthe current frame of the first-domain predictive residual from thesecond sample point of the current frame of the first-domain predictiveresidual signal: calculate an LP signal of a current sample pointaccording to a second-domain signal of the decoded sample point, whereinthe bit stream comprises both a best pitch and a pitch gain, or both thebit stream comprises the best pitch and a pitch gain; and obtain asecond-domain predictive signal according to the LP signal and aLong-Term Prediction (LTP) contribution signal if the obtained long-termflag value is a first value, or obtain a second-domain predictive signalaccording to the LP signal if the obtained long-term flag value is not afirst value, wherein the LTP contribution signal is obtained accordingto the LP residual signal of the decoded sample point; a convertingmodule, configured to convert the second-domain predictive signal into afirst-domain predictive signal, and convert the first-domain signal ofthe current sample point into the second-domain signal; a current samplepoint decoding module, configured to decode the first-domain signal ofthe current sample point according to the first-domain predictiveresidual signal and the first-domain predictive signal; and an LPresidual module, configured to obtain an LP residual signal according tothe second-domain signal and the LP signal, wherein at least one of thebit stream decoding module, the first sample point decoding module, thesample point decoding module, the converting module, the current samplepoint decoding module or the LP residual module, is a hardware module.19. The apparatus of claim 18, wherein if the long-term flag value is afirst value and the current sample point in encoder participates in theLTP processing, the sum of the LP residual signal and the LTPcontribution signal is used as the second-domain predictive signal; ifthe long-term flag value is a first value and the current sample pointin encoder does not participate in the LTP processing, the LPCpredictive signal is used as the second-domain predictive signal. 20.The apparatus of claim 18, wherein the apparatus further comprises: apitch gain module, configured to selecting the pitch gain adaptivelyaccording to the best pitch.
 21. A signal codec system, comprising: asignal coding apparatus, configured to convert a first-domain signalinto a second-domain signal, perform a Linear Prediction (LP) processingand a Long-Term Prediction (LTP) processing for the second-domain signalto obtain a LP processing result and a LTP processing result, whereinthe LTP processing result comprises a LTP residual signal, a best pitchof the LP residual signal or both the best pitch of the LP residualsignal and a pitch gain of the LP residual signal, obtain a long-termflag value; obtain a second-domain predictive signal based on the LPprocessing result and the LTP processing result if the long-term flagvalue is a first value, or obtain a second-domain predictive signalbased on the LP processing result if the long-term flag value is asecond value; convert the second-domain predictive signal into afirst-domain predictive signal, and calculate a first-domain predictiveresidual signal according to the first-domain predictive signal; andoutput a bit stream that comprises the first-domain predictive residualsignal; a signal decoding apparatus, configured to decode the receivedbit stream to obtain the first-domain predictive residual signal and thelong-term flag value, wherein the first-domain predictive residualsignal is formatted into frames, each frame comprises one or more samplepoints; decode a first sample point of the signals of a current frame,and perform the following decoding steps consecutively for every currentsample point from a second sample point of the signals of the currentframe of the first-domain predictive residual from the second samplepoint of the current frame of the first-domain predictive residualsignal: calculating an LP signal of a current sample point according tothe second-domain signal of the decoded sample point, wherein the bitstream comprises both a best pitch and a pitch gain, or both the bitstream comprises the best pitch and a pitch gain; obtaining thesecond-domain predictive signal according to the LP signal and an LTPcontribution signal if the obtained long-term flag value is the firstvalue, or obtaining the second-domain predictive signal according to theLP signal if the obtained long-term flag value is not the first value,wherein the LTP contribution signal is obtained according to the LPresidual signal of the decoded sample point, converting thesecond-domain predictive signal into the first-domain predictive signal;decoding the first-domain signal of the current sample point accordingto the first-domain predictive residual signal and the first-domainpredictive signal, converting the first-domain signal of the currentsample point into the second-domain signal, and obtaining the LPresidual signal according to the second-domain signal and the LP signal.